package com.parking.mapper;

import com.parking.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {
    //增加
    @Insert("insert into user(username, usernumber, userphone,usermony,usertype,useramount) values (#{username},#{usernumber},#{userphone},#{usermony},#{usertype},#{useramount});")
    int add(User user);

    //删除
    @Delete("delete from user where userid = #{userid}")
    int delete(int userid);


    //修改
    @Update("update user set usermony = #{usermony} where userid = #{userid}")
    int updateById(Integer usermony,Integer userid);

    //查询
    @Select("select * from user where userid = #{userid}")
    User selectById(int userid);
}
